package at.codejedi.sto.model.combat;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;

import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.CascadeType;
import org.hibernate.annotations.GenericGenerator;

@Entity
public class CombatLog {

	private List<IBattle> battles;

	private List<IPlayer> players;

	private String uuid;

	@OneToMany(targetEntity = Battle.class)
	@Cascade(CascadeType.ALL)
	public List<IBattle> getBattles() {
		return battles;
	}

	@OneToMany(targetEntity = Player.class)
	@Cascade(CascadeType.ALL)
	public List<IPlayer> getPlayers() {
		return players;
	}

	@Id
	@GeneratedValue(generator = "system-uuid")
	@GenericGenerator(name = "system-uuid", strategy = "uuid")
	@Column(name = "uuid", unique = true)
	public String getUuid() {
		return uuid;
	}

	public void setBattles(List<IBattle> battles) {
		this.battles = battles;
	}

	public void setPlayers(List<IPlayer> players) {
		this.players = players;
	}

	public void setUuid(String uuid) {
		this.uuid = uuid;
	}

}
